/*************************************************************************
  > File Name: try_catch_throw.cpp
  > Author: LiangHuaxiao
  > Mail: 1184903633@qq.com
  > Created Time: Tue 25 Apr 2023 09:08:22 PM
 ************************************************************************/

#include <iostream>
#include <string>
#include <exception>
using namespace std;

void func(){
    throw "Unknown Exception";  //抛出异常
    cout<<"[1]This statement will not be executed."<<endl;
}

int main(){
    try{
        func();
        cout<<"[2]This statement will not be executed."<<endl;
    }catch(const char* &e){
        cout<<e<<endl;
    }

    return 0;
}

